<div class="r0 p20 pt10 col-xs-12" ng-controller="interfaceDetailCtrl">
	<button type="button" class="ndis" id="refresh"
		ng-click="getData(1,true);"></button>
	<div class="col-xs-12 p0 f12 lh26 interface-detail">
		<div class="bb1 fb f20 pb10 C555 mt0">
			<div class="fl m0">Url：{{model.moduleUrl}}{{model.url}}</div>
			<div class="fr m0">
				版本号： <a href="javascript:void(0)" class="f12 btn btn-purple btn-xs"><i
					class="iconfont">&#xe620;&nbsp;</i>{{model.version}}</a> <a
					ng-href="#/{{model.projectId}}/front/interfaceDetail/{{version.id}}"
					class="f12 btn btn-default btn-xs" ng-repeat="version in versions">
					<i class="iconfont">&#xe620;&nbsp;</i>{{version.version}}
				</a> <a
					ng-href="#/{{model.projectId}}/front/interface/debug/{{model.id}}"
					class="f12 btn btn-default btn-xs"> <i class="iconfont">&#xe625;&nbsp;</i>调试
				</a>
			</div>
			<div class="cb"></div>
		</div>
		<blockquote>
			<p class="cursor" style="color: #000;">目录</p>
			<p class="cursor" onclick="scrollToId('1')">1 功能说明</p>
			<p class="cursor pl20" onclick="scrollToId('1_1')">1.1 接口名</p>
			<p class="cursor pl20" onclick="scrollToId('1_2')">1.2 版本号</p>
			<p class="cursor pl20" onclick="scrollToId('1_3')">1.3 接口说明</p>
			<p class="cursor pl20" onclick="scrollToId('1_4')">1.4 接口状态</p>
			<p class="cursor" onclick="scrollToId('2')">2 接口调用说明</p>
			<p class="cursor pl20" onclick="scrollToId('2_1')">2.1 URL</p>
			<p class="cursor pl20" onclick="scrollToId('2_2')">2.2 Mock地址</p>
			<p class="cursor pl20" onclick="scrollToId('2_3')">2.3 HTTP请求方式</p>
			<p class="cursor pl20" onclick="scrollToId('2_4')">2.4 请求头说明</p>
			<p class="cursor pl20" onclick="scrollToId('2_5')">2.5 输入参数说明</p>
			<p class="cursor pl20" onclick="scrollToId('2_6')">2.6 请求示例</p>
			<p class="cursor pl20" onclick="scrollToId('2_7')">2.7 返回参数说明</p>
			<p class="cursor pl20" onclick="scrollToId('2_8')">2.8 正确返回示例</p>
			<p class="cursor pl20" onclick="scrollToId('2_9')">2.9 错误返回示例</p>
			<p class="cursor pl20" onclick="scrollToId('2_10')">2.10 错误码</p>
			<p class="cursor pl20" onclick="scrollToId('2_11')">2.11 通道地址</p>
		</blockquote>
		<div class="fb f18" id="1">1 功能说明</div>
		<div id="1_1">1.1 接口名</div>
		{{model.interfaceName}}

		<div id="1_2">1.2 版本号</div>
		<span ng-bind="model.version"></span>

		<div id="1_3">1.3 接口说明</div>
		<span ng-bind-html="model.remark|trustHtml"></span>

		<div id="1_4">1.4 接口状态</div>
		<span ng-if="model.status==1">可用</span> <span ng-if="model.status==0">不可用</span>

		<div class="fb f18" id="2">2接口调用说明</div>
		<div id="2_1">2.1 URL</div>
		{{model.moduleUrl}}{{model.url}}

		<div id="2_2">2.2 Mock地址</div>
		<blockquote>
			<a ng-href="{{settings.DOMAIN}}/mock/trueExam.do?id={{model.id}}"
				target="_blank">正确数据URL</a>
		</blockquote>

		<input type="text"
			class="form-control m10 input-xs dis-in-blo b0 no-b-s"
			value="{{settings.DOMAIN}}/mock/trueExam.do?id={{model.id}}">

		<blockquote>
			<a ng-href="{{settings.DOMAIN}}/mock/falseExam.do?id={{model.id}}"
				target="_blank">错误数据URL</a>
		</blockquote>

		<input type="text"
			class="form-control m10 input-xs dis-in-blo b0 no-b-s"
			value="{{settings.DOMAIN}}/mock/falseExam.do?id={{model.id}}">


		<div id="2_3">2.3 HTTP请求方式</div>
		{{model.method|removeLast}}

		<div id="2_4">2.4 请求头说明</div>
		<span ng-if="headers!=null&&headers.length==0"> 无 </span>
		<table class="table table-bordered"
			ng-if="headers!=null && headers.length>0">
			<thead>
				<tr class="BGEEE C000">
					<th class="tc">名称</th>
					<th class="tc">是否必须</th>
					<th class="tc">类型</th>
					<th class="tc">默认值</th>
					<th class="tc w300">备注</th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="item in headers">
					<td class="tc fb C000">{{item.name}}</td>
					<td class="tc C000">{{item.necessary}}</td>
					<td class="tc C000">{{item.type}}</td>
					<td class="tc C000">{{item.def}}</td>
					<td class="tc C000">{{item.remark}}</td>
				</tr>
			</tbody>
		</table>

		<div id="2_5">2.5 输入参数说明</div>
		<div class="code" ng-if="model.customParams">
			<div class="bb1 mt0 pt0">自定义参数（Custom）</div>
			<pre>{{model.customParams}}</pre>
			<!-- 自定义参数备注 -->
			<div class="bb1 mt0 pt0">自定义参数备注（Custom）</div>
			<table class="table table-bordered" ng-if="paramRemarks.length>0">
				<thead>
					<tr class="BGEEE C000">
						<th class="w50"></th>
						<th class="tc">名称</th>
						<th class="tc w100">类型</th>
						<th class="tc w100">是否必须</th>
						<th class="tc w200">备注</th>
					</tr>
				</thead>
				<tbody>
					<tr ng-repeat="item in paramRemarks">
						<td class="tc" style="color: red;">{{item.deep}}</td>
						<td class="C000 pl20"><span
							style="padding-left: {{item.deep*15+ 'px'">{{item.name}}</span></td>
						<td class="tc C000">{{item.type}}</td>
						<td class="tc C000">{{item.necessary}}</td>
						<td class="tc C000">{{item.remark}}</td>
					</tr>
				</tbody>
			</table>
		</div>


		<!-- 如果不判断formParams!=null,当formParams还没加载成功,hasRequestHeader就会被调用导致报错 -->
		<span ng-if="formParams!=null && formParams.length==0"> 无 </span>

		<table class="table table-bordered"
			ng-if="formParams!=null && formParams.length>0">
			<thead>
				<tr class="BGEEE C000">
					<th class="tc">名称</th>
					<th class="tc">是否必须</th>
					<th class="tc">参数位置</th>
					<th class="tc">类型</th>
					<th class="tc">默认值</th>
					<th class="tc w300">备注</th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="item in formParams">
					<td class="tc fb C000">{{item.name}}</td>
					<td class="tc C000">{{item.necessary}}</td>
					<td class="tc C000" ng-if="item.inUrl && item.inUrl=='true'">请求URL</td>
					<td class="tc C000" ng-if="!item.inUrl || item.inUrl!='true'">普通参数</td>
					<td class="tc C000">{{item.type}}</td>
					<td class="tc C000">{{item.def}}</td>
					<td class="tc C000">{{item.remark}}</td>
				</tr>
			</tbody>
		</table>

		<div id="2_6">2.6 请求示例</div>
		<div class="code">
			<pre>{{model.requestExam}}</pre>
		</div>

		<div id="2_7">2.7 返回参数说明</div>
		<span ng-if="responseParams.length==0">无</span>
		<table class="table table-bordered" ng-if="responseParams.length>0">
			<thead>
				<tr class="BGEEE C000">
					<th class="w50"></th>
					<th class="tc">名称</th>
					<th class="tc w100">类型</th>
					<th class="tc w100">是否必须</th>
					<th class="tc w200">备注</th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="item in responseParams">
					<td class="tc" style="color: red;">{{item.deep}}</td>
					<td class="C000 pl20"><span
						style="padding-left: {{item.deep*15+ 'px'">{{item.name}}</span></td>
					<td class="tc C000">{{item.type}}</td>
					<td class="tc C000">{{item.necessary}}</td>
					<td class="tc C000">{{item.remark}}</td>
				</tr>
			</tbody>
		</table>

		<div id="2_8">2.8 正确返回示例</div>
		<span ng-if="!model.trueExam">无</span>
		<div class="code" ng-if="model.trueExam">
			<pre>{{model.trueExam}}</pre>
		</div>

		<div id="2_9">2.9 错误返回示例</div>
		<span ng-if="!model.falseExam">无</span>
		<div class="code" ng-if="model.falseExam">
			<pre>{{model.falseExam}}</pre>
		</div>

		<div id="2_10">2.10 错误码</div>
		<span ng-if="errors.length==0">无</span>
		<table class="table table-bordered" ng-if="errors.length>0">
			<thead>
				<tr class="BGEEE C000">
					<th class="tc w200">Code</th>
					<th class="tc">Msg</th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="item in errors">
					<td class="tc fb C000">{{item.errorCode}}</td>
					<td class="tc C000">{{item.errorMsg}}</td>
				</tr>
			</tbody>
		</table>

		<div id="2_11">2.11 通道地址</div>
		<blockquote>
			<a ng-href="{{settings.KONG}}/app/{{model.moduleName}}{{model.url}}"
				target="_blank">通道地址</a>
		</blockquote>
		<input type="text"
			class="form-control m10 input-xs dis-in-blo b0 no-b-s"
			value="{{settings.KONG}}/app/{{model.moduleName}}{{model.url}}">

	</div>
</div>
<div class="cb"></div>

